This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
Firstly, you are using lots of variants that should be Strings.
"Dim filesys,FullPath,OUName,FileName,Path" creates 5 variants. These all need to be "Dim"ed separately.
Secondly, you should use the full path, not just the filename in this line:
Set Object = rtitem.EmbedObject(EMBED_ATTACHMENT,"",FileName,OUName)
So bring back the lines you commented out (and you can replace them with one line in fact) and correct the EmbedObject code:
FullPath = doc.Getitemvalue("FullPath")(0)
Set Object = rtitem.EmbedObject(EMBED_ATTACHMENT,"",FullPath,OUName)
Finally, if I were re-writing your script entirely, I would use more doc commands and fewer uidoc commands. It gives you greater control over data types, and reduces confusion, but for now I presume you just want to get your code working !
Hope this helps,
Phil
Feedback response number WEBB94WDQA created by ~Justin Chugeromanli on 02/14/2013